-- GENERATED SPELL FOR [Lightning Construct] --


function spell0_27972(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(61528,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27972', 1500, 1)
end

function spell1_27972(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(52383,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27972', 3000, 1)
end

function spell2_27972(pUnit, Event) --@Electrical Overload,Self--
pUnit:FullCastSpellOnTarget(59038,pUnit)
pUnit:RegisterEvent('Sorts_27972', 1500, 1)
end

function spell3_27972(pUnit, Event) --@Electrical Overload,Self--
pUnit:FullCastSpellOnTarget(52341,pUnit)
pUnit:RegisterEvent('Sorts_27972', 1500, 1)
end

function Sorts_27972(pUnit, Event)
local choix_sorts_27972 = math.random(0, 3)
if choix_sorts_27972 == 0 then
pUnit:RegisterEvent('spell0_27972', 1, 1)
end
if choix_sorts_27972 == 1 then
pUnit:RegisterEvent('spell1_27972', 1, 1)
end
if choix_sorts_27972 == 2 then
pUnit:RegisterEvent('spell2_27972', 1, 1)
end
if choix_sorts_27972 == 3 then
pUnit:RegisterEvent('spell3_27972', 1, 1)
end
end

function mob27972_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27972', math.random(1500, 3000), 1)
end

function mob27972_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27972_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27972_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27972, 1, 'mob27972_Action')
RegisterUnitEvent(27972, 2, 'mob27972_Leave')
RegisterUnitEvent(27972, 3, 'mob27972_Kill')
RegisterUnitEvent(27972, 4, 'mob27972_Die')
